package com.news.servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import com.news.service.UserService;


@WebServlet("/adminuserdelete")
public class AdminUserDeleteServlet extends HttpServlet {

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String id = request.getParameter("id");
		// 根据id删除数据
		UserService userService = new UserService();
		boolean flag = userService.deleteUser(Integer.parseInt(id));
		if (flag) {
			response.sendRedirect(request.getContextPath()+"/adminuserlist");
		}
	}


}
